package mapper;

import model.Course;
import model.Teacher;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface TeacherCourseMapper {
    //查找某个老师教授的所有课程的信息
    @Select("select c.* from course c,tbl_teachercourse  tc where tc.teacher_id=#{teacher_id} and c.id=tc.course_id")
    List<Course> selectByTeacherId(int teacher_id);
    //查找教授某门课程的所有老师的信息
    @Select("select t.* from  teacher t,tbl_teachercourse tc where tc.course_id=#{course_id} and t.Id=tc.teacher_id")
    List<Teacher> selectByCourseId(int course_id);
}
